UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A0kwzLxkIkng0x4tSD6qRI0t9iDjH1ug0Bj2ufyri/c=' 
WHERE 
  key_id = 'b8c4f2502d4b887af726d4b2cc81b96e6495ab87a05a604a8ddf7382258f519d' 
  AND (
    token = 'A0kwzLxkIkng0x4tSD6qRI0t9iDjH1ug0Bj2ufyri/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056