UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wOMTcYCPRTeYeFLVLRie5wWGoIToo7c2JNmActqWocw=' 
WHERE 
  key_id = 'f162824e624bc82fcb69c96bedae122e703a0148314b9bebdd09a1dbefaafd94' 
  AND (
    token = 'wOMTcYCPRTeYeFLVLRie5wWGoIToo7c2JNmActqWocw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037