UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sPhGlGvrrGTPz1BEkLkWV+VWkY5e4XjQ2KE/zA4c18g='
WHERE
key_id = 'd93d4594596b9b0233a979de9e1ce2c4f10573306cbd14f897fa3fcd9bf9ac26'
AND (
token = 'sPhGlGvrrGTPz1BEkLkWV+VWkY5e4XjQ2KE/zA4c18g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)