UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bsIMV1n9vpuT83YyJa8Khb5/LmFkOrLC/JBektu/D/c=' 
WHERE 
  key_id = '25d3aff6e86d3a666123c3b67901a0b1af9ccbf0389f72a0c6af882926dd1d3d' 
  AND (
    token = 'bsIMV1n9vpuT83YyJa8Khb5/LmFkOrLC/JBektu/D/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040