UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'crmjNx/arFNWXV+7WJbwkv5MvYgMuPNMxNe6RyW80LQ='
WHERE
key_id = '8ec3d153bb41c7f33fd9024f54d206a1d343b4588c815a87e783d8cadbe4f2a2'
AND (
token = 'crmjNx/arFNWXV+7WJbwkv5MvYgMuPNMxNe6RyW80LQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)