UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FRsmu4kqNH0mc5wxi4svxH8epljXeJb3kJ1EWLF/aZY='
WHERE
key_id = 'e4c9fe8f54c3d5217441860921afe52b9ebad9fe528541659123ef33dd4f14f5'
AND (
token = 'FRsmu4kqNH0mc5wxi4svxH8epljXeJb3kJ1EWLF/aZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)