UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'junkyLGyK9TvaZKj1I0a8c9p9xzKuUPcVN3vV/50qDA=' 
WHERE 
  key_id = '95c70bd688a67d8df33fe088925421fcf970b9a2f30bc12b31d354c78071b8fe' 
  AND (
    token = 'junkyLGyK9TvaZKj1I0a8c9p9xzKuUPcVN3vV/50qDA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029