UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oeFqacJGvr1vuq5ax2f6xn9AnDiBF4xzVZFgSnGX/u8=' 
WHERE 
  key_id = '9a73d40bf436093a7ff9411bbcb3e15cbb6c8ef1965f91b3f63c001127e20cd5' 
  AND (
    token = 'oeFqacJGvr1vuq5ax2f6xn9AnDiBF4xzVZFgSnGX/u8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035