UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z4d4xRavRwG0Rlklis3iSzugJrhY/J5v7jIjb1Jhvhs=' 
WHERE 
  key_id = '22f685bbcb003bf973128f20649bc3564bb1d61731b22686c8c6ca89527b3cba' 
  AND (
    token = 'z4d4xRavRwG0Rlklis3iSzugJrhY/J5v7jIjb1Jhvhs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026