UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E3eD5c0ELQUjHCtoihK9pM+IZXLtyw1noQDgZ6KB5Bk=' 
WHERE 
  key_id = 'bb623ca32d690563fa2d08537292d928a0902f05f1ea68650f3c565125321bbf' 
  AND (
    token = 'E3eD5c0ELQUjHCtoihK9pM+IZXLtyw1noQDgZ6KB5Bk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041