UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UqDhm0CAgOtckNm4MEiS9AWISJeF80XPID2skCp6gD0=' 
WHERE 
  key_id = '9043da2d985012fa443c16bcb0d5ff6fa35f48bdabcafc09548ca72cffbf6c34' 
  AND (
    token = 'UqDhm0CAgOtckNm4MEiS9AWISJeF80XPID2skCp6gD0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028