UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FDaIQYfTI+WzpfhE6VSD58V2UPbyvbwzmytbXvncgkg='
WHERE
key_id = '1f2944828bcd92b380a4f26f87086ef68460feb04a9052b0db63abb08c228162'
AND (
token = 'FDaIQYfTI+WzpfhE6VSD58V2UPbyvbwzmytbXvncgkg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)