UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rOe3YtWXTOAQBHBM4KSasrgkwd3TKyAyUzIugUf1jXk='
WHERE
key_id = 'e7ab4993ac4a9ed14de89f6ba10375a7c20cd175cfd359b3b3eff8194a86588a'
AND (
token = 'rOe3YtWXTOAQBHBM4KSasrgkwd3TKyAyUzIugUf1jXk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)