UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C2USJqMQ6rM5Vnfo9qog5sqkjm8DM6zXtbzafu3EXBc=' 
WHERE 
  key_id = '7c756bed318d9cde6bfa544c58133ac12017df65fa7ce2daaa00e358d8bc417e' 
  AND (
    token = 'C2USJqMQ6rM5Vnfo9qog5sqkjm8DM6zXtbzafu3EXBc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031