UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jg38EOxRDi5J6AXumTUJAybcpgVa94e1aMK/Kl2Bm6g=' 
WHERE 
  key_id = '5835e33c0553d75864721647a3795c788e7f5aa0f4c4c9513b0ba5f18e0117cd' 
  AND (
    token = 'Jg38EOxRDi5J6AXumTUJAybcpgVa94e1aMK/Kl2Bm6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063