UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hFbaAAf0BlNkcQyWPvAFr9E8nIs5N87zzXvpL6QswpQ='
WHERE
key_id = '69392a08514a233d61702e205ace6691804d4084187304e1d29504016b1dc29a'
AND (
token = 'hFbaAAf0BlNkcQyWPvAFr9E8nIs5N87zzXvpL6QswpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)