UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y9P4dvI7vrN2XhEIvhyAFzEeWKCxLOLG9+LL2XVN+B0=' 
WHERE 
  key_id = '1801fc72be73ab2a02078c6dd9c002ccdd6f3b7659f540ef5f8e3dba2b926a28' 
  AND (
    token = 'y9P4dvI7vrN2XhEIvhyAFzEeWKCxLOLG9+LL2XVN+B0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038