UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ROMD5Hc0O8aPOo/oDJqkg7V/dX3Qc1p77YyIWwcLxsU='
WHERE
key_id = 'ecaf453a299f769339451e3da8572abcd96f93062aebec3585488cfe46745e50'
AND (
token = 'ROMD5Hc0O8aPOo/oDJqkg7V/dX3Qc1p77YyIWwcLxsU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)