UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9fedlspHH+aBLOH/sgjaivSG1jB13g/y0P5JJ8Quy7w='
WHERE
key_id = '4e2b4d5f7c405395c0dd39eefaa70161c49f7ec275d6830365a9d0e353a0a914'
AND (
token = '9fedlspHH+aBLOH/sgjaivSG1jB13g/y0P5JJ8Quy7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)