UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4PzQSUo0170z/tsC7OsFMN55d0EW+f6+4QWDOBSeoAg='
WHERE
key_id = 'ddd2e63304e53be4e6610b63cca6d12c37d837e00795a1873cab6faa36ee9edd'
AND (
token = '4PzQSUo0170z/tsC7OsFMN55d0EW+f6+4QWDOBSeoAg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)