UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OpS5mZeidK2TGAcob1od0gQ/bk+za2/SSg8wRk6OzFU='
WHERE
key_id = '5abeeb6092f6396f45cbcb33971e85a172cbc94f94d50aa82aaa3cab738266f7'
AND (
token = 'OpS5mZeidK2TGAcob1od0gQ/bk+za2/SSg8wRk6OzFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)