UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TigkLgBa5FCA7gQNjEMt3CHAxCua+5NlWR1VCxRC2Yc=' 
WHERE 
  key_id = '505355801d2b8e49390459ece4158d3d08c3f0a4c6b589d00bf91950af9532bc' 
  AND (
    token = 'TigkLgBa5FCA7gQNjEMt3CHAxCua+5NlWR1VCxRC2Yc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024