UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IlqT7svCbBecv+zI1Lmabeu5P7TePcuX8w8M2tP8PgQ=' 
WHERE 
  key_id = 'f26533844e43cce9f6670cc7665602850386f4823b2b8d6d1ee62f6a52de7a5a' 
  AND (
    token = 'IlqT7svCbBecv+zI1Lmabeu5P7TePcuX8w8M2tP8PgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033