UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ibzwWasf+YzAicFREnWqmZF3cx+FUm1ks/nY2xcdun4=' 
WHERE 
  key_id = 'afd09d5fe8c63742ea17f03683d1898e39a3fd00cdcb1b1153be02af24656601' 
  AND (
    token = 'ibzwWasf+YzAicFREnWqmZF3cx+FUm1ks/nY2xcdun4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030