UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JhbJK33Lwjvn0Mx0/+BRSABvVO0Edxv5FzA/Omsjc7M='
WHERE
key_id = 'a57eed629dc42bda0f1304f64dd93719be4950810c1043713e0ff6178f78ae7b'
AND (
token = 'JhbJK33Lwjvn0Mx0/+BRSABvVO0Edxv5FzA/Omsjc7M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)