UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b4E8MqmHWSBG71oTnxxMH2hljZ61KMiUg6oYsxFWjes=' 
WHERE 
  key_id = '3c9bce726a2997bbd0735cce8f079efd0330358ff996fd4c130bff2da0675a0f' 
  AND (
    token = 'b4E8MqmHWSBG71oTnxxMH2hljZ61KMiUg6oYsxFWjes=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020