UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T+MVA/BDcLRP67MTKdqGD9fBydh9lFVcCHMUzkpOWgo='
WHERE
key_id = 'e235db5634684437a8fd748c30bf327495517ee61f445f891e5c5d343fa976e4'
AND (
token = 'T+MVA/BDcLRP67MTKdqGD9fBydh9lFVcCHMUzkpOWgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)