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