UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6438RHw0OLspfrgdGlUXHVTDl7nVzRtsaGTY+JNLCs0='
WHERE
key_id = '861b9fdcbb4c1727e7959eae3c41b9dd3ef03cc8a1c8c30277b877c7de95f12a'
AND (
token = '6438RHw0OLspfrgdGlUXHVTDl7nVzRtsaGTY+JNLCs0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)