UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'edPIGmXYA/j+5D5WQcRNh4kYm5t7fvopA7um/e55rGk=' 
WHERE 
  key_id = '12b70f580500474b6c84fb7479da7c90fea750684e4bafcaf82f4b3739752bfd' 
  AND (
    token = 'edPIGmXYA/j+5D5WQcRNh4kYm5t7fvopA7um/e55rGk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032