UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '98dTzLsULiS0XIy+g+Aso1wn9XOMiNT1OrFK1blWPcg=' 
WHERE 
  key_id = 'cc91267560df3175f629f25aec08c4e39d4724162ebe76a3dc4b2719a4f63ea7' 
  AND (
    token = '98dTzLsULiS0XIy+g+Aso1wn9XOMiNT1OrFK1blWPcg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043