UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G8WsxVxODdhodt7yuHdxfvo3deSDgpoiLf+mujanD2s='
WHERE
key_id = 'd9be82b0aa60728bac71e0004e8d7c647f4622e5e72cfdb15380386e357fa7ed'
AND (
token = 'G8WsxVxODdhodt7yuHdxfvo3deSDgpoiLf+mujanD2s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)