UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/in6OkA+1/JLU5Sw5wBkF7TvCbuj9L/BeBUHNt+ohp0='
WHERE
key_id = '7e0bbcc924cef3933d8d4b4bf5575f7e42009ca0e82b5f6fb19d864baf4acbde'
AND (
token = '/in6OkA+1/JLU5Sw5wBkF7TvCbuj9L/BeBUHNt+ohp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)