UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VT4DF2et7dQVMqVWai62Xcb5SHcCmNs4snoaTLIUmtE='
WHERE
key_id = '0e294c12cd7b1120256d3a1055fa460b8b417a69c15a3555a1f2e3ea33217c41'
AND (
token = 'VT4DF2et7dQVMqVWai62Xcb5SHcCmNs4snoaTLIUmtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)